package edu.predatorwars.client.visualization;


import java.awt.Point;
import java.util.List;

import java.util.UUID;

import com.badlogic.gdx.ApplicationListener;

import edu.predatorwars.shared.models.Creature;

public class Visualization implements ApplicationListener , BoardRendererInterface, StartGameRendererInterface {

	VisualizationStarter vs;
	ApplicationListener renderer;
	BoardRenderer br;
	StartGameRenderer sgr;
	
	public Visualization(VisualizationStarter vstart) {
		vs = vstart;
		//renderer = br = new BoardRenderer(vs);
		renderer = sgr= new StartGameRenderer(vs);
	}
	
	@Override
	public void create() {
		SharedVisResources.init();
		renderer.create();
		
	}

	@Override
	public void resume() {
		renderer.resume();
	}

	@Override
	public void render() {
		renderer.render();
	}

	@Override
	public void resize(int width, int height) {
		renderer.resize(width, height);
	}

	@Override
	public void pause() {
		renderer.pause();
	}

	@Override
	public void dispose() {
		renderer.dispose();
	}

	
	
	/*The Following Methods are for the BoardRendererInterface*/
	@Override
	public void showLoading(Boolean b) {
		br.showLoading(b);
	}

	@Override
	public void showWin(Boolean b) {
		br.showWin(b);
	}

	@Override
	public void showLose(Boolean b) {
		br.showLose(b);
	}

	@Override
	public void showDisconnected(Boolean b) {
		br.showDisconnected(b);
	}

	@Override
	public void showMyTurn(Boolean b) {
		br.showMyTurn(b);
	}

	@Override
	public void setMoves(List<Point> moves) {
		br.setMoves(moves);
	}

	@Override
	public void setBoard(VisLocation[][] board) {
		br.setBoard(board);
	}

	@Override
	public void setMyPlayer(VisPlayer player) {
		br.setMyPlayer(player);
	}

	@Override
	public void setTurnsLeft(String turns) {
		br.setTurnsLeft(turns);
	}

	@Override
	public void updatePlayers(
			List<TDataSet<VisPlayer, PlayerExt, Point>> players) {
		br.updatePlayers(players);
	}

	@Override
	public void addPlayers(List<VisPlayer> players) {
		br.addPlayers(players);
	}

	@Override
	public void removePlayers(List<VisPlayer> players) {
		br.removePlayers(players);
	}

	@Override
	public void addResources(List<VisResource> resources) {
		br.addResources(resources);
	}

	@Override
	public void removeResources(List<VisResource> resources) {
		br.removeResources(resources);
	}

	@Override
	public void addTerrain(List<DataSet<VisTerrain, FPoint>> terrain) {
		br.addTerrain(terrain);
	}

	@Override
	public void swapTerrain(List<DataSet<VisTerrain, TerrainExt>> terrain) {
		br.swapTerrain(terrain);
	}

	@Override
	public void disposeTerrain(List<VisTerrain> terrain) {
		br.disposeTerrain(terrain);
	}

	@Override
	public void showHome(Boolean b) {
		// TODO Auto-generated method stub
		
	}

	
	@Override
	public void showGames() {
		sgr.showGames();
	}


	@Override
	public void showCreatures() {
		sgr.showCreatures();
	}

	@Override
	public void showWaiting() {
		sgr.showWaiting();
	}

	@Override
	public void setGames(List<UUID> game_uuids, List<String> game_names) {
		sgr.setGames(game_uuids, game_names);
	}
	


	@Override
	public void setCreatures(List<Creature> creatures) {
		sgr.setCreatures(creatures);
	}
	
	
}